package com.autumn.spring.boot.bean;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.ResourceLoaderAware;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.env.Environment;
import org.springframework.core.io.ResourceLoader;

/**
 * Bean 定义注册抽象
 * 
 * @author 老码农
 *
 *         2017-11-27 17:52:52
 */
public abstract class AbstractImportBeanDefinitionRegister
		implements ImportBeanDefinitionRegistrar, ResourceLoaderAware, EnvironmentAware {

	/**
	 * 日志
	 */
	public final Log logger = LogFactory.getLog(this.getClass());

	private Environment environment;
	private ResourceLoader resourceLoader;

	/**
	 * 获取环境
	 * 
	 * @return
	 */
	public Environment getEnvironment() {
		return environment;
	}

	@Override
	public void setEnvironment(Environment environment) {
		this.environment = environment;
	}

	/**
	 * 取获资源适配器
	 * 
	 * @return
	 */
	public ResourceLoader getResourceLoader() {
		return resourceLoader;
	}

	@Override
	public void setResourceLoader(ResourceLoader resourceLoader) {
		this.resourceLoader = resourceLoader;
	}
}
